package com.sfchen.cloud.exception;

import lombok.Getter;

@Getter
public enum BizCodeEnum {

    /**
     * 通用操作码
     */
    OPS_REPEAT(110001, "重复操作"),
    JSON_MESSAGE_ERROR(110002, "JSON格式错误"),

    /**
     * 验证码
     */
    CODE_TO_ERROR(240001, "接收号码不合规"),
    CODE_LIMITED(240002, "验证码发送过快"),
    CODE_ERROR(240003, "验证码错误"),
    CODE_CAPTCHA(240101, "图形验证码错误"),

    /**
     * 账号
     */
    ACCOUNT_REPEAT(250001, "账号已经存在"),
    ACCOUNT_UNREGISTER(250002, "账号不存在"),
    ACCOUNT_PWD_ERROR(250003, "账号或者密码错误"),
    ACCOUNT_ADDRESS_ERROR(250004, "用户地址错误"),

    REFRESH_TOKEN_ERROR(250005, "刷新令牌信息错误"),
    ACCOUNT_TOKEN_ERROR(250006, "请登录后再操作"),
    ACCOUNT_COMPETENCE_ERROR(250007, "权限不足"),

    /**
     * 流控操作
     */

    CONTROL_FLOW(500101, "限流控制"),

    CONTROL_DEGRADE(500201, "降级控制"),

    CONTROL_AUTH(500301, "认证控制"),
    CONTROL_PARAM_FLOW(500401, "参数限流控制"),

    /**
     * 文件相关
     */
    FILE_UPLOAD_USER_IMG_FAIL(600101, "用户头像文件上传失败"),

    ;

    private final String message;

    private final Integer code;

    BizCodeEnum(Integer code, String message) {
        this.message = message;
        this.code = code;
    }
}